[HVM] Add sub instruction support to HVM MMIO decoder.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 30 Sep 2006 10:08:41 +0000 (11:08 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sat, 30 Sep 2006 10:08:41 +0000 (11:08 +0100)
This is needed for SMP PAE windows XP SP2.

Signed-off-by: Xin Li <xin.b.li@intel.com>
xen/arch/x86/hvm/io.c
xen/arch/x86/hvm/platform.c
xen/include/asm-x86/hvm/io.h

index be2ab476950ad152c97014efde5236ac529cf081..f91f37f95d4f1fafe2e684075010ae49275a1ad4 100644 (file)
@@ -596,6 +596,7 @@ static void hvm_mmio_assist(struct cpu_user_regs *regs, ioreq_t *p,
         break;
 
     case INSTR_CMP:
+    case INSTR_SUB:
         if (src & REGISTER) {
             index = operand_index(src);
             value = get_reg_value(size, index, 0, regs);
@@ -607,6 +608,8 @@ static void hvm_mmio_assist(struct cpu_user_regs *regs, ioreq_t *p,
             index = operand_index(dst);
             value = get_reg_value(size, index, 0, regs);
             diff = value - (unsigned long) p->u.data;
+            if ( mmio_opp->instr == INSTR_SUB )
+                set_reg_value(size, index, 0, regs, diff);
         }
 
         /*
index 14f77f1aaf72085a7a37e1a534ae1f6c9a4a6ab3..20cb7ba75f2d6fc99e270005db35dbf8b8d667bd 100644 (file)
@@ -394,6 +394,11 @@ static int hvm_decode(int realmode, unsigned char *opcode, struct instruction *i
         GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
         return mem_reg(instr->op_size, opcode, instr, rex);
 
+    case 0x2B: /* sub m32/16, r32/16 */
+        instr->instr = INSTR_SUB;
+        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
+        return mem_reg(instr->op_size, opcode, instr, rex);
+
     case 0x30: /* xor r8, m8 */
         instr->instr = INSTR_XOR;
         instr->op_size = BYTE;
@@ -1011,6 +1016,7 @@ void handle_mmio(unsigned long va, unsigned long gpa)
 
     case INSTR_CMP:        /* Pass through */
     case INSTR_TEST:
+    case INSTR_SUB:
         mmio_opp->flags = mmio_inst.flags;
         mmio_opp->instr = mmio_inst.instr;
         mmio_opp->operand[0] = mmio_inst.operand[0]; /* source */
index 0c594fdafa86f917ceb087693784cd1fba269363..8ec4747967a15d9535da09300ee1491af5541c36 100644 (file)
@@ -68,6 +68,7 @@
 #define INSTR_TEST  12
 #define INSTR_BT    13
 #define INSTR_XCHG  14
+#define INSTR_SUB   15
 
 struct instruction {
     __s8    instr;        /* instruction type */